<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ include file="../include/header.jsp" %>
<div id="main">
    <div id="container">
        <div id="content">
            <div id="noResult" style="width:600px;margin:auto;">
                <c:if test="${add == 1}">
                    <h1>Ajout de Photos : ${requestScope['nom']}</h1>
                    <form id="uploadPhoto" method="post" action="AlbumServlet?action=edit&IdAlbum=${requestScope['id']}">
                        <div id="uploader">
                            <p>You browser doesn't have Flash, Silverlight, Gears, BrowserPlus or HTML5 support.</p>
                        </div>
                        <input type="submit" name="submit" id="uploadPhotoSubmit" value="Envoyer" />
                    </form>
                </c:if>
                <c:if test="${add != 1}">
                    <h1>Edition des photos : ${requestScope['nom']}</h1>
                    <c:if test="${!empty lstPhotos}">
                        <form action="AlbumServlet?action=modify&IdAlbum=${requestScope['id']}" method="post">
                        <table style="width:600px;">
                        <tr>
                            <td>Titre / Description</td>
                            <td>Image</td>
                        </tr>
                        <c:forEach var="photo" items="${lstPhotos}">
                            <tr>
                                <td style="padding-bottom: 15px;padding-right:10px;vertical-align: top">
                                    <input type="text" name="photos_${photo.id}_titre" value="${photo.nom}"/><br />
                                    <textarea name="photos_${photo.id}_description">${photo.description}</textarea>
                                </td>
                                <td style="padding-bottom:15px;width:150px;">
                                    <p><img src="upload/${requestScope['idAuteur']}/${requestScope['id']}/${photo.pathThumbList}"/></p>
                                </td>
                            </tr>
                        </c:forEach>
                        </table>
                        <input type="submit" name="submit" value="Sauvegarder les modifications"/>
                        </form>
                    </c:if>
                </c:if>
            </div>
        </div><!-- #content -->
    </div><!-- #container -->
</div><!-- #main -->
<%@ include file="../include/footer.jsp" %>